package java_class_work.week05;

import java.io.File;

public class FileOperator4 {
    public static void main(String[] args) {
        File file = new File(".\\src\\java_class_work");
        df(file, 0);
    }

    /**
     * 层级输出每层文件
     * @param file
     * @param level
     */
    private static void df(File file, int level) {
        for (int i = 0; i < level; i++)
            System.out.print("\t");
        ++level;
        System.out.println(file.getName());
        if (file.isDirectory())
            for (File f : file.listFiles()) df(f, level);
    }
}
